import request from "@/utils/index.js";

export const generatePurchaseOrderService = (data) => {
    return request.post("/api/purchaseOrder", data);
}

//分页展示进货单
export const getPurchaseOrderListService = (currentPage, pageSize) => {
    return request.get("/api/purchaseOrder", {params: {currentPage, pageSize}});
}

// 确认进货单完成
export const confirmPurchaseOrderService = (id) => {
    if (!id) {
        throw new Error("Purchase order ID is required");
    }
    return request.put(`/api/purchaseOrder/confirm/${id}`);
}